package com.juqimiao.raccoon.commodity.appobj;

import com.juqimiao.raccoon.commodity.constraints.OperationNewGroup;
import com.juqimiao.linn.model.AppObject;
import com.juqimiao.raccoon.commodity.constraints.OperationUpdateGroup;
import lombok.Data;

import javax.validation.constraints.*;

@Data
public class CategoryGroupAO extends AppObject {

    private String id;
    @NotNull
    private String name;
    @NotNull
    private String spell;
    /**
     * There may the way to group the category for purpose.
     * basic
     */
    @NotNull(groups = {OperationNewGroup.class, OperationUpdateGroup.class},
            message = "不能为空。")
    @Size(groups = {OperationNewGroup.class, OperationUpdateGroup.class},
            max = 25,
            message = "长度超过25个字符。")
    private String groupType;
    /**
     * 使用场景
     */
    @NotNull(groups = {OperationNewGroup.class, OperationUpdateGroup.class},
            message = "不能为空。")
    @Size(groups = {OperationNewGroup.class, OperationUpdateGroup.class},
            max = 25,
            message = "长度超过25个字符。")
    private String scenario;
    /**
     * 是否发布。
     */
    private Boolean publish;
    /**
     * 是否通过认证。
     */
    private Boolean authorized;
    /**
     * 提交ID。 平台、一般用户提交。
     */
    @NotNull(groups = {OperationNewGroup.class})
    private String submitId;

    @Min(0)
    @Max(200)
    private Integer sortOrder;

    @Null(groups = {OperationNewGroup.class})
    private String status;
}
